<!DOCTYPE html PUBLIC 
    "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
<html 
	xmlns="http://www.w3.org/1999/xhtml" 
	xmlns:ui="http://java.sun.com/jsf/facelets" 
	xmlns:h="http://java.sun.com/jsf/html" 
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:t="http://myfaces.apache.org/tomahawk"> 

	<ui:component>
		<h:panelGroup>
		<table class="results" id="routerConfigUpload">
			<thead>
				<tr>
					<th colspan="2"><h:outputText value="#{msgs['router.content.custconf.title']}" /></th>
				</tr>
				<tr>
					<td colspan="2">
						<h:panelGroup rendered="#{!routerBean.started}">
							<h:outputText value="#{msgs['router.content.custconf.subtitle']}" />
						</h:panelGroup>
						<h:panelGroup rendered="#{routerBean.started}">
							<h:outputText value="#{msgs['general.alreadystarted']}" />
						</h:panelGroup>
					</td>
				</tr>
				<tr>
					<td colspan="2" class="message">
						<h:message for="routerConfigUploadForm:routerConfigUpload"/>
						<h:outputText value="#{routerCustomConfigActionHandler.message}"/>					
					</td>
				</tr>
			</thead>		
			<tbody class="results">
				<h:form enctype="multipart/form-data" id="routerConfigUploadForm">							
				<tr class="cells">
					<td width="350px">
						<h:outputText value="#{msgs['router.content.custconf.msg1']}" />
					</td>
					<td> 
						<t:inputFileUpload 
							id="routerConfigUpload"
							disabled="#{routerBean.started}"
							value="#{routerCustomConfigActionHandler.uploadedConfigFile}"
							storage="file"/> 
					</td>
				</tr>
				<tr class="cells">
					<td>
						<h:outputText value="#{msgs['router.content.custconf.msg2']}" />
					</td>
					<td>
						<h:commandButton 
							disabled="#{routerBean.started}"
							value="#{msgs['router.content.custconf.start']}" 
							action="#{routerBean.getStatus}"
							actionListener="#{routerCustomConfigActionHandler.uploadConfigFileAndStart}"/>							
						<h:commandButton
							disabled="#{!routerBean.started}" 
							action="#{routerBean.getStatus}" 
							actionListener="#{routerBean.stop}"
							value="#{msgs['router.menu.action.stop']}"/>
					</td>				
				</tr>
				</h:form>
			</tbody>
		</table>
		</h:panelGroup>	
		<br/>
		<br/>
	</ui:component>
</html>	